package com.fdd.op.sdk.request.api.company;

import com.fdd.op.sdk.ApiRuleException;
import com.fdd.op.sdk.BaseFddRequest;
import com.fdd.op.sdk.constants.Constants;
import com.fdd.op.sdk.internal.mapping.RequestField;
import com.fdd.op.sdk.internal.util.StringUtils;
import com.fdd.op.sdk.response.api.company.CreateCompanyResponse;

import java.util.Map;

public class CreateCompanyRequest extends BaseFddRequest<CreateCompanyResponse> {

    @Override
    public String getApiMethodName() {
        return "/user/api/company/createCompany";
    }

    @Override
    public Map<String, Object> getTextParams() {
        return null;
    }

    @Override
    public Class<CreateCompanyResponse> getResponseClass() {
        return CreateCompanyResponse.class;
    }

    @Override
    public void check() throws ApiRuleException {
        if(StringUtils.isBlank(getCompanyName())){
            throw new ApiRuleException("22030", "企业名称不能为空");
        }
        if(StringUtils.isBlank(getAdminName())){
            throw new ApiRuleException("22035", "企业管理员名称不能为空");
        }
    }

    @Override
    public String getHttpMethod() {
        return Constants.METHOD_POST;
    }

    @RequestField(value = "企业名称，初始化的企业名称，实名认证之后则以实名的为准，当前集团内不允许重复")
    private String companyName;

    @RequestField(value = "企业在第三方业务系统的唯一标识")
    private String tpOrgId;

    @RequestField(value = "企业系统管理员，企业创建后将把此联系人作为企业的系统管理员，并进行相关消息通知接收")
    private String adminName;

    @RequestField(value = "企业系统管理员在第三方业务系统的唯一标识")
    private String tpAccountId;

    @RequestField(value = "手机号区号，非必传，默认+86，传参时需带“+”号")
    private String areaCode;

    @RequestField(value = "企业系统管理员手机号，手机号码和邮箱不能同时为空")
    private String adminMobile;

    @RequestField(value = "企业系统管理员邮箱，手机号码和邮箱不能同时为空")
    private String adminEmail;

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getTpOrgId() {
        return tpOrgId;
    }

    public void setTpOrgId(String tpOrgId) {
        this.tpOrgId = tpOrgId;
    }

    public String getAdminName() {
        return adminName;
    }

    public void setAdminName(String adminName) {
        this.adminName = adminName;
    }

    public String getTpAccountId() {
        return tpAccountId;
    }

    public void setTpAccountId(String tpAccountId) {
        this.tpAccountId = tpAccountId;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    public String getAdminMobile() {
        return adminMobile;
    }

    public void setAdminMobile(String adminMobile) {
        this.adminMobile = adminMobile;
    }

    public String getAdminEmail() {
        return adminEmail;
    }

    public void setAdminEmail(String adminEmail) {
        this.adminEmail = adminEmail;
    }
}
